<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    241. Different Ways to Add Parentheses
   </h1>
   <p>
    Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are
    <code>
     +
    </code>
    ,
    <code>
     -
    </code>
    and
    <code>
     *
    </code>
    .
   </p>
   <p>
    <b>
     Example 1:
    </b>
   </p>
   <pre>
<b>Input:</b> <code>"2-1-1"</code>
<b>Output:</b> <code>[0, 2]</code>
<strong>Explanation: </strong>
((2-1)-1) = 0 
(2-(1-1)) = 2</pre>
   <p>
    <b>
     Example 2:
    </b>
   </p>
   <pre>
<b>Input: </b><code>"2*3-4*5"</code>
<b>Output:</b> <code>[-34, -14, -10, -10, 10]</code>
<strong>Explanation: 
</strong>(2*(3-(4*5))) = -34 
((2*3)-(4*5)) = -14 
((2*(3-4))*5) = -10 
(2*((3-4)*5)) = -10 
(((2*3)-4)*5) = 10<strong>
</strong></pre>
  </div>
  <div>
   <h1 class="question_title">
    241. 为运算表达式设计优先级
   </h1>
   <p>
    给定一个含有数字和运算符的字符串，为表达式添加括号，改变其运算优先级以求出不同的结果。你需要给出所有可能的组合的结果。有效的运算符号包含
    <code>
     +
    </code>
    ,&nbsp;
    <code>
     -
    </code>
    &nbsp;以及&nbsp;
    <code>
     *
    </code>
    &nbsp;。
   </p>
   <p>
    <strong>
     示例&nbsp;1:
    </strong>
   </p>
   <pre><strong>输入:</strong> <code>"2-1-1"</code>
<strong>输出:</strong> <code>[0, 2]</code>
<strong>解释: </strong>
((2-1)-1) = 0 
(2-(1-1)) = 2</pre>
   <p>
    <strong>
     示例&nbsp;2:
    </strong>
   </p>
   <pre><strong>输入: </strong><code>"2*3-4*5"</code>
<strong>输出:</strong> <code>[-34, -14, -10, -10, 10]</code>
<strong>解释: 
</strong>(2*(3-(4*5))) = -34 
((2*3)-(4*5)) = -14 
((2*(3-4))*5) = -10 
(2*((3-4)*5)) = -10 
(((2*3)-4)*5) = 10</pre>
  </div>
 </body>
</html>